public class SolutionOffer46 {
    public int translateNum(int num) {
        String n=String.valueOf(num);
        int[] f=new int[n.length()];
        f[0]=1;
        for (int i=1;i<n.length();i++){
            int p=(n.charAt(i-1)-'0')*10+n.charAt(i)-'0';
            if (p<=25 && p>=0 && n.charAt(i-1)!='0'){
                f[i]=i==1?1:f[i-2];
            }
            f[i]+=f[i-1];
        }
        return f[n.length()-1];
    }

    public static void main(String[] args) {
        System.out.println(new SolutionOffer46().translateNum(12258));
    }
}
